﻿@model GroceryList.Front.Web.ViewModels.ProductoViewModel

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>Productos</title>

    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
</head>
<body>

    @using (Html.BeginForm("Index","Producto"))
    {
        @Html.ValidationSummary(true)
        <fieldset>
            <legend>Producto</legend>

            <div class="editor-label">
                @Html.LabelFor(model => model.Producto.Nombre)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Producto.Nombre)
                @Html.ValidationMessageFor(model => model.Producto.Nombre)
            </div>

            <p>
                <input type="submit" value="Nuevo producto" />
            </p>
        </fieldset>
    }


    <table>
    @foreach (var item in Model.Productos)
    { 
        <tr> 
            <td> 
                @Html.DisplayFor(modelItem => item.Nombre) 
            </td> 
        </tr> 
    }
    </table>
</body>
</html>
